﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Payroll.BusinessLogic.Infrastructure;

namespace Payroll.BusinessLogic.EmployeeManagement
{
    public partial class EmployeeSession : BaseEntity
    {
       
            #region Fields
            private Employee _employee;
            #endregion

            #region Properties
            /// <summary>
            /// Gets or sets the customer session identifier
            /// </summary>
            public Guid EmployeeSessionGuid { get; set; }
            /// <summary>
            /// Gets or sets the customer identifier
            /// </summary>
            public int EmployeeId { get; set; }

            /// <summary>
            /// Gets or sets the last accessed date and time
            /// </summary>
            public DateTime LastAccessed { get; set; }

            /// <summary>
            /// Gets or sets a value indicating whether the customer session is expired
            /// </summary>
            public bool IsExpired { get; set; }
            
            #endregion

            #region Employee Properties

            public Employee employee
            {
                get
                {
                    if (_employee == null)
                        _employee = IoC.Resolve<IEmployeeService>().GetEmployeeById(this.EmployeeId);
                    return _employee;
                }
            }
            #endregion
    }
}
